#ifndef SENDFILECLASS_H
#define SENDFILECLASS_H

#include <QObject>
#include <QTcpSocket>
#include <QFile>
#include <QFileInfo>
#include <QThread>
#include <QQueue>
#include <QPair>
#include <QDate>
#include "AbstractLayer/FileTransmisson/sendqueue.h"
#include "AbstractLayer/MsgHandler/myjson.h"
#include "AbstractLayer/Encipher/encipher.h"
#include "AbstractLayer/Database/chatbuf.h"
class SendFileClass : public QObject
{
    Q_OBJECT
public:
    explicit SendFileClass(QObject *parent = nullptr);
    void initSendFileClass();
    void sendFile(QString senderoc,QString receiveroc,QString filepath);
signals:
    void s_sendDone();
    void s_startTask(QString);
    void s_speed(float value);
public slots:
    void sendFileBlock();
    void getTask();
private:
    void Verify();


private:
    QTcpSocket* sendfilesocket;
    QString currentsendingfilepath;
    QFile* sendingfile;
    int totalsize;
    int senddonesize;
    int index;

    QString currentfilename;
    QString currentfriendoc;
};

#endif // FILECLASS_H
